package top.szhome.develop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import top.szhome.framework.starter.db.support.SimpleServiceImpl;
import top.szhome.develop.convert.TemplateSchemaConverter;
import top.szhome.develop.dto.TemplateSchemaDTO;
import top.szhome.develop.entity.TemplateSchema;
import top.szhome.develop.mapper.TemplateSchemaMapper;
import top.szhome.develop.service.TemplateSchemaService;
import top.szhome.develop.vo.TemplateSchemaVO;
/**
 * 模板方案服务实现
 *
 * @author 唐加利
 * @date 2023/08/21
 **/
@AllArgsConstructor
@Service
@Slf4j
public class TemplateSchemaServiceImpl extends SimpleServiceImpl<TemplateSchemaMapper, TemplateSchemaConverter, TemplateSchemaDTO, TemplateSchema, TemplateSchemaVO> implements TemplateSchemaService {

    @Override
    public TemplateSchema getTemplateSchema(String code) {
        LambdaQueryWrapper<TemplateSchema> query = Wrappers.lambdaQuery(TemplateSchema.class).eq(TemplateSchema::getCode, code);
        return getBaseMapper().selectOne(query);
    }

}
